package com.mk.admin.controller;

import com.mk.admin.log.WriteLog;
import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.DoctorOnlineSchedulingQuery;
import com.mk.admin.model.vo.DoctorOnlineSchedulingVo;
import com.mk.admin.service.DoctorOnlineSchedulingService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/doctorOnlineScheduling")
@Api(tags = "医生线上问诊排班")
public class DoctorOnlineSchedulingController {
    @Autowired
    private DoctorOnlineSchedulingService doctorOnlineSchedulingService;

    @PostMapping("/select")
    @WriteLog("医生线上排班查询")
    public ResultDto select(@RequestBody DoctorOnlineSchedulingQuery query) {
        return doctorOnlineSchedulingService.select(query);
    }

    @PostMapping("/add")
    @WriteLog("医生线上排班新增")
    public ResultDto add(@RequestBody DoctorOnlineSchedulingVo vo) {
        return doctorOnlineSchedulingService.add(vo);
    }

    @PostMapping("/update")
    @WriteLog("医生线上排班修改")
    public ResultDto update(@RequestBody DoctorOnlineSchedulingVo vo) {
        return doctorOnlineSchedulingService.update(vo);
    }

    @PostMapping("/delete")
    @WriteLog("医生线上排班删除")
    public ResultDto delete(@RequestBody DoctorOnlineSchedulingVo vo) {
        return doctorOnlineSchedulingService.delete(vo.getId());
    }

    @PostMapping("/status")
    @WriteLog("医生线上排班状态")
    public ResultDto status(@RequestBody DoctorOnlineSchedulingVo vo) {
        return doctorOnlineSchedulingService.status(vo.getId());
    }
}
